<template>
  <div>
    <h2>Hello World</h2>
    <h2>{{message}}</h2>

    <button @click="emitEvent">发射事件</button>
  </div>
</template>

<script setup>
//通过defineProps来父子传递
//通过defineEmit来传递事件
import {defineProps,defineEmits} from "vue";
const props = defineProps({
  message:{
    type:String,
    default:"哈哈哈"
  }
})

const emit = defineEmits(["increment","decrement"]);

const emitEvent = () => {
  emit('increment','100000');
}

</script>

<style scoped>

</style>